<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>论坛页面</title>
    <style>
        .footer{clear: both;}
        .footer p {text-align: center;}
        .nav p{text-align: right}
        .nav nav{text-align: right}
        .table thead{font-weight: bold}
    </style>
    <!-- Bootstrap -->
    <link href="Content/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<%@ include file="/shared/header.jsp"  %>
    <div id="path">
        <ol class="breadcrumb">
            <li><a href="index.htm">首页</a></li>
            <li><a href="register.html">搜查结果</a></li>
        </ol>
    </div>
    <div id="content">
    
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">搜查出标题包含“${title }”的记录${row }条</h3>
            </div>
            <div class="panel-body">
                <div class="panel panel-default">
                    <!-- Default panel contents -->
                    <table class="table">
                        <thead>
                        <tr>
                            <td>主题</td>
                            <td>作者</td>
                            <td>回复</td>
                            <td>最后更新时间</td>
                        </tr>
                        <tbody>
                        <c:forEach items="${topic}" var="t">
                        <tr>
                            <td><a href="#">${t.title }</a></td>
                            <td>${t.user.nickname }</td>
                            <td>3/116</td>
                            <td>${t.updateTime }</td>
                        </tr>
                        </c:forEach>
                       
                        </tbody>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
        
        <div class="nav">
            <nav aria-label="...">
            <ul class="pagination">
                <c:if test="${pageNum>1}">
                	<li class="active"><a href="AfterSearchServlet?pageNum=${pageNum-1}&title=${title}" aria-label="Previous"><span aria-hidden="true">&lt;</span></a></li>
                </c:if>
                <c:if test="${pageNum<=1}">
                    <li class="disabled"><a href="AfterSearchServlet?pageNum=${pageNum }&title=${title}" aria-label="Previous"><span aria-hidden="true">&lt;</span></a></li>
                </c:if>
                <c:if test="${pageNum<totalPage }">
                    <li class="active"><a href="AfterSearchServlet?pageNum=${pageNum+1 }&title=${title}">&gt;<span class="sr-only">(current)</span></a></li>
                </c:if>
                <c:if test="${pageNum>=totalPage }">
                    <li class="disabled"><a href="AfterSearchServlet?pageNum=${pageNum }&title=${title}">&gt;<span class="sr-only">(current)</span></a></li>
                </c:if>
            </ul>
        </nav>
        <p>共${totalPage }页，第${pageNum }页</p>
        </div>
    </div>
        <%@ include file="/shared/footer.jsp" %>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="Content/bootstrap/jquery/jquery-1.11.3.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="Content/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>